//
//  BBMeshController.h
//  BBTouch
//
//  Created by ben smith on 8/13/08.
//  This file is part of BBTouch.
//
//  BBTouch is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  BBTouch is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.

//  You should have received a copy of the GNU Lesser General Public License
//  along with BBTouch.  If not, see <http://www.gnu.org/licenses/>.
// 
//  Copyright 2008 Ben Britten Smith ben@benbritten.com .
//

#import <Cocoa/Cocoa.h>

// handles the camera mesh and the screen mesh and the distortion map

@class BBDistortionMap;
@class BBDistortionMesh;

@interface BBMeshController : NSObject {
	BBDistortionMap * distortionMap;
	// local copies of the height and width so we can 
	// generate new meshes easily
	NSInteger meshHeight;
	NSInteger meshWidth;
}

@property (retain) BBDistortionMap * distortionMap;
@property (assign) NSInteger meshHeight;
@property (assign) NSInteger meshWidth;

+ (BBMeshController*)sharedMeshController;
- (BBDistortionMesh*)cameraMesh;
- (BBDistortionMesh*)screenMesh;
- (IBAction)loadMap:(id)sender;
- (IBAction)makeNewMeshes:(id)sender;
- (IBAction)saveMap:(id)sender;
- (IBAction)recalculateMap:(id)sender;
- (NSRect)meshFrame;
- (NSRect)regionOfInterest;
- (void)appBegin:(id)note;
- (void)appQuit:(id)note ;
- (void)awakeFromNib;

- (IBAction)flipCameraMeshHorizontally:(id)sender;
- (IBAction)flipCameraMeshVertically:(id)sender;

-(IBAction)expandCameraMesh:(id)sender;
-(IBAction)expandScreenMesh:(id)sender;

// 11 methods





@end
